package com.aos.erp.manager.model.notice.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("通知公告查询条件")
public class NoticeConditionVo implements Serializable {

    @ApiModelProperty(value = "每页查询数量", dataType = "Integer")
    private int pageSize = 20;
    @ApiModelProperty(value = "当前页码", dataType = "Integer")
    private int pageIndex = 1;
    @ApiModelProperty(value = "公告标题", hidden = true)
    private String noticeTitle="";
    @ApiModelProperty(value = "公告内容", hidden = true)
    private String noticeContent="";
    @ApiModelProperty(value = "发布人", hidden = true)
    private String publisher="";
    @ApiModelProperty(value = "发布开始时间", hidden = true)
    private String fromTime="";
    @ApiModelProperty(value = "发布截止时间", hidden = true)
    private String toTime="";
    @ApiModelProperty(value = "组织ID(组织查询时传入)", hidden = true)
    private long orgId=0;

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public long getOrgId() {
        return orgId;
    }

    public void setOrgId(long orgId) {
        this.orgId = orgId;
    }

    public String getNoticeTitle() {
        return noticeTitle;
    }

    public void setNoticeTitle(String noticeTitle) {
        this.noticeTitle = noticeTitle;
    }

    public String getNoticeContent() {
        return noticeContent;
    }

    public void setNoticeContent(String noticeContent) {
        this.noticeContent = noticeContent;
    }

    public String getPublisher() {
        return publisher;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    public String getFromTime() {
        if(fromTime.length() > 0 && fromTime.length() == 10) {
            fromTime = fromTime + " 00:00:00";
        }
        return fromTime;
    }

    public void setFromTime(String fromTime) {
        this.fromTime = fromTime;
    }

    public String getToTime() {
        if(toTime.length() > 0 && toTime.length() == 10) {
            toTime = toTime + " 23:59:59";
        }
        return toTime;
    }

    public void setToTime(String toTime) {
        this.toTime = toTime;
    }
}
